import { useEffect } from 'react'
import { ImageBackground, StyleSheet, View } from 'react-native'

export default function Index({ navigation }: any) {
    const nextPage = (page: string) => {
        setTimeout(() => {
            navigation.navigate(page)
        }, 1000)
    }

    useEffect(() => {
        const asyncFun = async () => {
            nextPage('home')
        }
        asyncFun()
    }, [])

    return (
        <View style={styles.container}>
            <ImageBackground source={{ uri: 'https://legacy.reactjs.org/logo-og.png' }} resizeMode="cover" style={styles.image}>
            </ImageBackground>
        </View>
    )
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
    },
    image: {
        flex: 1
    }
})
